package com.deyuanyun.pic.settings.enumeration;

/**
 * 阀值设置相关枚举
 *  @author axiao(xj08.dream@gmail.com)
 *  @date 2016-06-21
 *  @version 1.0
 *  Histroy: [修改人][时间][描述]
 */
public enum ThresholdType {

    //*******************风险评价 begin ********************
    RISK_EVALUATION("RISK_EVALUATION","风险评价", 1),

    //威胁因素
    RISK_IMMEDIATE_REPAIR("RISK_IMMEDIATE_REPAIR","立即修复的管体缺陷",2),
    RISK_CORROSION_PERCENT("RISK_CORROSION_PERCENT", "内腐蚀占比", 2),
    RISK_OVER_UNDER_PROTECTION("RISK_OVER_UNDER_PROTECTION", "过保护与欠保护", 2),
    RISK_AC_DC_INTERFERENCE("RISK_AC_DC_INTERFERENCE", "交流直流干扰", 2),

    RISK_MENACE_MISOPERATION("RISK_MENACE_MISOPERATION","误操作", 2),
    RISK_MENACE_MANUFACTURE_CONSTRUCTION("RISK_MENACE_MANUFACTURE_CONSTRUCTION", "制造和施工", 2),
    RISK_MENACE_GEOLOGIC_HAZARD("RISK_MENACE_GEOLOGIC_HAZARD","地质灾害" , 2),
    RISK_MENACE_THIRD_PARTY_DAMAGE("RISK_MENACE_THIRD_PARTY_DAMAGE","第三方破坏", 2),

    RISK_SYSTEM_SCHEDULE("RISK_SYSTEM_SCHEDULE","系统风险推送任务调度", 2),
    RISK_PIPE_SCHEDULE("RISK_PIPE_SCHEDULE","风险评价周期任务调度", 2),

    //********************风险评价结束 end ******************

    //*******************完整性评价 begin ********************
    INTEGRITY_ASSESSMENT("INTEGRITY_ASSESSMENT", "完整性评价", 1),

    //内检测
    INTERNAL_INSP_PIPE_SCHEDULE("INTERNAL_INSP_PIPE_SCHEDULE", "内检测周期任务调度",2),
    INTERNAL_INSP_RESULT_INPUT("INTERNAL_INSP_RESULT_INPUT", "内检测结果录入" , 2),
    INTERNAL_INSP_APPRAISE("INTERNAL_INSP_APPRAISE", "提醒开展内检测数据评价工作", 2),
    INTERNAL_INSP_INPUT_APPRAISE("INTERNAL_INSP_INPUT_APPRAISE", "内检测评价数据录入", 2),
    INTERNAL_INSP_DEFECT_NOTICE_SCHEDULE("INTERNAL_INSP_DEFECT_NOTICE_SCHEDULE", "内检测缺陷最迟维修时间任务调度", 2),
    INTERNAL_INSP_INSIDE_METAL_LOSS("INTERNAL_INSP_INSIDE_METAL_LOSS", "两次对比内部金属损失" , 2),
    INTERNAL_INSP_OUTSIDE_METAL_LOSS("INTERNAL_INSP_OUTSIDE_METAL_LOSS", "两次对比外部金属损失", 2),

    //外检测
    INTERNAL_EXTE_PIPE_SCHEDULE("INTERNAL_EXTE_PIPE_SCHEDULE", "外检测周期任务调度", 2),
    INTERNAL_CATHODIC_PROTECTION_INPUT("INTERNAL_CATHODIC_PROTECTION_INPUT", "阴极保护有效性评价结果录入", 2),
    INTERNAL_POTENTIAL_INPUT("INTERNAL_POTENTIAL_INPUT", "电位桩完好结果录入", 2),
    INTERNAL_AC_CURRENT_DENSITY_INPUT("INTERNAL_AC_CURRENT_DENSITY_INPUT", "交流干扰检测记录录入", 2),
    INTERNAL_DC_CURRENT_DENSITY_INPUT("INTERNAL_DC_CURRENT_DENSITY_INPUT","直流干扰检测记录录入", 2),
    INTERNAL_INSULATION_JOINT_INPUT("INTERNAL_INSULATION_JOINT_INPUT", "绝缘接头检测结果录入", 2),
    INTERNAL_SACRIFICIAL_ANODE_INPUT("INTERNAL_SACRIFICIAL_ANODE_INPUT", "牺牲阳极检测结果录入", 2),
    INTERNAL_PROTECTING_COATING_INPUT("INTERNAL_PROTECTING_COATING_INPUT", "防腐层评价结果录入", 2),
    INTERNAL_PROTECTING_COATING_ADVISE_INPUT("INTERNAL_PROTECTING_COATING_ADVISE_INPUT", "防腐层漏损点维护建议列表录入", 2),
    INTERNAL_OPERATION_RECORD("INTERNAL_OPERATION_RECORD", "阴保运行消息推送", 2),


    //*******************完整性评价 end ********************


    //*******************缺陷评价 begin ********************

    DEFECT_EVALUATION("DEFECT_EVALUATION", "缺陷评价", 1),

    DEFECT_IMMEDIATE_REPAIR("DEFECT_IMMEDIATE_REPAIR", "立即维修和ERF信息设置", 2),
    DEFECT_METAL_LOSS("DEFECT_METAL_LOSS", "金属损失信息设置", 2),
    DEFECT_PIT("DEFECT_PIT", "凹陷信息设置", 2),
    DEFECT_GIRTH_WELD("DEFECT_GIRTH_WELD", "焊缝异常信息设置", 2),

    DEFECT_REPAIR_TASKS("DEFECT_REPAIR_TASKS", "维修维护项目启动/关闭设置", 2),

    DEFECT_EFFECTIVENESS_EVALUATION("DEFECT_EFFECTIVENESS_EVALUATION", "效能评价信息设置", 2);

    //*******************缺陷评价 begin ********************

    private String value;

    private String msg;

    private int level;//级数

    private ThresholdType(String value, String msg, int level){
        this.value = value;
        this.msg = msg;
        this.level = level;
    }

    public String getValue(){
        return value;
    }

    public String getMsg() {
        return msg;
    }

    public int getLevel() {
        return level;
    }

    public static ThresholdType getThresholdType(String value) {
        ThresholdType[] thresholdTypes = ThresholdType.values();
        for (int i = 0, len = thresholdTypes.length; i < len; i++) {
            if(thresholdTypes[i].getValue().equals(value)) {
                return thresholdTypes[i];
            }
        }
        return null;
    }


}
